package com.jingfei.drools.drl;

import lombok.extern.slf4j.Slf4j;
import org.kie.api.KieServices;
import org.kie.api.runtime.KieContainer;
import org.kie.api.runtime.KieSession;

/**
 * @Author jingfei
 * @Date 2022/7/25 21:00
 */

@Slf4j
public class TestMain {

    public static void main(String[] args) {
        KieServices kieService = KieServices.Factory.get();
        KieContainer kieContainer = kieService.getKieClasspathContainer();
        KieSession kieSession = kieContainer.newKieSession("testKieSession");
        int count = kieSession.fireAllRules();
        log.info("总共执行了" + count + "条规则！");
        kieSession.dispose();
    }

}
